import Mock  from "mockjs";

Mock.setup({
    //设置随机请求延时时间
    timeout: '200-500'
})

//模拟获取验证码
Mock.mock(/\/common\/slideSecret/,'get',()=>{
    const data = Mock.mock({
        code: 200,
        msg: '登录成功',
        data: '1748092693427900416'
    })
    return data;
})

//模拟登录
Mock.mock(/\/system\/login\/pwdLogin/,'post',()=>{
    const data = Mock.mock({
        code: 200,
        msg: '登录成功',
        data: 'mockToken'
    })
    return data;
})

//模拟获取路由菜单
Mock.mock(/\/system\/menu\/tree/,'get',()=> {
    const data = Mock.mock({
        code: 200,
        msg: '操作成功',
        data: [
            {
                menuId:1,
                name: '系统管理',
                parentId: 0,
                orderNum: 1,
                path: '/system',
                icon: 'icon-xitongguanli',
                perms: '',
                menuType: 'M',
                child: [
                    {
                        menuId:11,
                        name: '企业管理',
                        parentId: 1,
                        orderNum: 1,
                        component:'/system/company',
                        path: '/system/company',
                        icon: 'icon-qiyeyuanquwuye',
                        perms: 'system:users:qq:manager',
                        menuType: 'C',
                        child: [
                            {
                                menuId:111,
                                name: '新增企业',
                                parentId: 11,
                                orderNum: 1,
                                component:'/system/company/companyAdd',
                                path: '/system/company/companyAdd',
                                perms: 'system:users:qq:manager',
                                menuType: 'F',
                            }
                        ]
                    },
                    {
                        menuId:12,
                        name: '用户管理',
                        parentId: 1,
                        orderNum: 2,
                        component:'/system/user',
                        path: '/system/user',
                        icon: 'icon-yonghuguanli',
                        perms: 'system:users:qq:manager',
                        menuType: 'C',
                    },
                    {
                        menuId:13,
                        name: '角色管理',
                        parentId: 1,
                        orderNum: 3,
                        component:'/system/role',
                        path: '/system/role',
                        icon: 'icon-jiaoseguanli',
                        perms: 'system:users:wechat:manager',
                        menuType: 'C',
                    },
                    {
                        menuId:14,
                        name: '菜单管理',
                        parentId: 1,
                        orderNum: 4,
                        component:'/system/menu',
                        path: '/system/menu',
                        icon: 'icon-caidan',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    },
                    {
                        menuId:15,
                        name: '字典管理',
                        parentId: 1,
                        orderNum: 5,
                        component:'/system/dict',
                        path: '/system/dict',
                        icon: 'icon-zidianpeizhi',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    }
                ]
            },
            {
                menuId:2,
                name: '审核管理',
                parentId: 0,
                orderNum: 1,
                path: '/verify',
                icon: 'icon-shenheguanli',
                perms: '',
                menuType: 'M',
                child: [
                    {
                        menuId:21,
                        name: '企业审核',
                        parentId: 2,
                        orderNum: 1,
                        component:'/verify/company',
                        path: '/verify/company',
                        icon: 'icon-qiyeyuanquwuye',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    },
                    {
                        menuId:22,
                        name: '审核流管理',
                        parentId: 2,
                        orderNum: 2,
                        component:'/verify/bpmn',
                        path: '/verify/bpmn',
                        icon: 'icon-a-shenheliu1',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    }
                ]
            },
            {
                menuId:3,
                name: '日志管理',
                parentId: 0,
                orderNum: 1,
                path: '/logo',
                icon: 'icon-yanfaguanli-rizhiguanli',
                perms: '',
                menuType: 'M',
                child: [
                    {
                        menuId:31,
                        name: '系统日志',
                        parentId: 3,
                        orderNum: 1,
                        component:'/logo/system',
                        path: '/logo/system',
                        icon: 'icon-shezhi-',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    },
                    {
                        menuId:32,
                        name: '业务日志',
                        parentId: 3,
                        orderNum: 2,
                        component:'/logo/business',
                        path: '/logo/business',
                        icon: 'icon-yewurizhi',
                        perms: 'system:users:below:manager',
                        menuType: 'C',
                    }
                ]
            },
            {
                menuId:4,
                name: '定时任务',
                parentId: 0,
                orderNum: 1,
                component:'/task',
                path: '/task',
                icon: 'icon-yanfaguanli-rizhiguanli',
                perms: '',
                menuType: 'C',
            }
        ]
    })
    return data;
}) 